public class Test {
    public int minNumberInRotateArray(int [] array) {
        if (array == null || array.length == 0){
            return 0;
        }
        int left = 0;
        int right = array.length-1;
        int mid = 0;
        while (left < right){

            if (right - left == 1){
                mid = right;
                break;
            }
            if (array[left] == array[right] && array[left] == array[mid]){
                int ret = array[left];
                for (int i = left+1; i < right; i++){
                    if(ret > array[i]){
                        ret = array[i];
                    }
                }
                return ret;
            }
            mid = (left + right) / 2;
            if (array[mid] >= array[left]){
                left = mid;
            }else{
                right = mid;
            }
        }
        return array[mid];



    }
}
